home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2004 #9
/
Amiga Plus CD - 2004 - No. 09.iso
/
amigaplus
/
tools
/
dev_libs
/
feelin040718
/
include
/
libraries
/
feelin.h
< prev
next >
Wrap
C/C++ Source or Header
|
2004-08-03
|
68KB
|
1,475 lines
#ifndef FEELIN_H
#define FEELIN_H
/*
** $VER: feelin.h 7.0 (2004/07/18)
**
** feelin.library definitions
**
** © 2001-2004 Olivier LAVIALE (gofromiel@numericable.fr)
*/
/// Module information
#include <exec/libraries.h>
#include <exec/semaphores.h>
#include <utility/hooks.h>
#include <proto/feelin.h>
#define TRUE -1L
#define ALL -1L
#define FV_VERSION 7
/*
All constants follow these rules :
FM_<method> - General method, understood by all classes [NUM]
FM_<class>_<method> - Class method [NUM,STR]
FA_<attrib> - General attribute, known by many classes. [NUM]
FA_<class>_<attrib> - Specific class attribute [NUM,STR]
FV_<class>_<value> - Special attribute value [NUM]
FS_<name> - Structure of arguments to a method [SYS]
FP_<class>_<value> - Preference, resolved on FM_Setup [STR]
FA_<attrib> definitions are followed by a comment [ISG] :
I : it's possible to specify this attribute at object creation time.
S : it's possible to change this attribute with F_Set().
G : it's possible to get this attribute with F_Get().
FR_<class> = Registered class id (unsigned 24 bits)
FR_<class>_MTHD = First Method ID of <class>
FR_<class>_ATTR = First Attribute ID of <class>
Ranges:
$F0000000 - $FFFFFFFF is reserved for Feelin methods.
$8F000000 - $8FFFFFFF is reserved for Feelin attributes.
$C0000000 - $CFFFFFFF is reserved for custom classes methods.
$8C000000 - $8CFFFFFF is reserved for custom classes attributes.
$4D000000 - 4DFFFFFFF is reserved for Dynamic methods.
$41000000 - 41FFFFFFF is reserved for Dynamic attributes.
Since v6 of feelin.library most classes use dynamic IDs instead of static
ones. Dynamic IDs are generated on the fly at run time, thus they are
different at each session and future proof. You should have a look at
Feelin_DEV.guide to learn more about this.
*/
#define MTHD_BASE 0xF0000000
#define ATTR_BASE 0x8F000000
#define FCCM_BASE 0xC0000000
#define FCCA_BASE 0x8C000000
#define DYNA_MTHD 0x4D000000 // 'M'000000
#define DYNA_ATTR 0x41000000 // 'A'000000
//+
/// Macros:
/// Macros / Drawing
#define _FPen(fp) SetAPen(rp,_pens[fp])
#define _APen(p) SetAPen(rp,p)
#define _BPen(p) SetBPen(rp,p)
#define _DrMd(m) SetDrMd(rp,m)
#define _Plot(x1,y1) WritePixel(rp,x1,y1)
#define _Move(x,y) Move(rp,x,y)
#define _Draw(x,y) Draw(rp,x,y)
#define _Boxf(x1,y1,x2,y2) RectFill(rp,x1,y1,x2,y2)
#define _Text(s,c) Text(rp,s,c)
//+
/// Macros / Object Generation
enum {
FV_MakeObj_Label = 1, // label:PTR TO CHAR, flags:LONG
FV_MakeObj_Button, // label:PTR TO CHAR
FV_MakeObj_Bar, // Horiz:BOOL
FV_MakeObj_BarTitle, // label:PTR TO CHAR
FV_MakeObj_Gauge, // Horiz:BOOl,LONG Min, LONG Max, LONG Value
FV_MakeObj_Slider, // Horiz:BOOl,LONG Min, LONG Max, LONG Value
FV_MakeObj_Prop, // Horiz:BOOl,LONG entries, LONG visible, LONG first
FV_MakeObj_String // label:PTR TO CHAR,maxlen:LONG
};
#define SimpleButton(x) F_MakeObj(FV_MakeObj_Button,x)
#define Bar F_MakeObjA(FV_MakeObj_Bar,NULL)
#define BarTitle(x) F_MakeObj(FV_MakeObj_BarTitle,x)
#define Gauge(h,mi,ma,v) F_MakeObj(FV_MakeObj_Gauge,h,mi,ma,v)
#define Prop(h,e,v,f) F_MakeObj(FV_MakeObj_Prop,h,e,v,f)
#define String(s,l) F_MakeObj(FV_MakeObj_String,s,l)
#define Slider(h,mi,ma,v) F_MakeObj(FV_MakeObj_Slider,h,mi,ma,v,TAG_DONE)
#define SliderA F_MakeObj(FV_MakeObj_Slider
#define Child FA_Child
#define End TAG_DONE)
//+
///Macros / Userfull
#ifdef _DCC
#define REG(x) __ ## x
#define ASM
#define SAVEDS __geta4
#else
#define REG(x) register __ ## x
#define ASM __asm
#define SAVEDS __saveds
#endif
#define REG_D0 REG(d0)
#define REG_D1 REG(d1)
#define REG_D2 REG(d2)
#define REG_D3 REG(d3)
#define REG_D4 REG(d4)
#define REG_D5 REG(d5)
#define REG_D6 REG(d6)
#define REG_D7 REG(d7)
#define REG_A0 REG(a0)
#define REG_A1 REG(a1)
#define REG_A2 REG(a2)
#define REG_A3 REG(a3)
#define REG_A4 REG(a4)
#define REG_A5 REG(a5)
#define REG_A6 REG(a6)
#define REG_A7 REG(a7)
#define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
#define _inside(a,a1,a2) ((a) >= (a1) && (a) <= (a2))
//+
//+
typedef void * FObject;
typedef unsigned long (ASM *FHookEntry)(REG_A2 FObject Obj,REG_A1 APTR Msg);
///Basic structures
struct FeelinNode {
struct FeelinNode *Next;
struct FeelinNode *Prev;
};
struct FeelinNodePri {
struct FeelinNodePri *Next;
struct FeelinNodePri *Prev;
/* end of FeelinNode header */
BYTE Priority;
UBYTE reserved1;
};
struct FeelinNodeNamed {
struct FeelinNodePri *Next;
struct FeelinNodePri *Prev;
BYTE Priority;
UBYTE reserved1;
/* end of FeelinNodePri header */
UWORD reserved2;
STRPTR Name;
};
struct FeelinList {
struct FeelinNode *Head;
struct FeelinNode *Tail;
};
struct FeelinListSemaphored {
struct FeelinNode *Head;
struct FeelinNode *Tail;
/* end of FeelinList header */
struct SignalSemaphore Semaphore;
};
struct FeelinNodeData {
struct FeelinNode *Next;
struct FeelinNode *Prev;
/* end of FeelinNode header */
APTR Data;
};
typedef struct FeelinHashLink FHashLink;
typedef struct FeelinHashTable FHashTable;
struct FeelinHashLink
{
FHashLink *Next;
UBYTE *Key;
ULONG KeyLength;
APTR Data;
};
struct FeelinHashTable
{
ULONG Size;
FHashLink **Entries;
/* entries bellow */
};
//+
struct FeelinBase
{
struct Library Libnode;
BPTR Console;
APTR PutChar;
struct ExecBase *SYS;
struct DosLibrary *DOS;
struct GfxBase *Graphics;
struct IntuitionBase *Intuition;
struct Library *Utility;
struct Library *Layers;
struct Library *Locale;
};
/***************************************************************************/
/*** feelin.library ********************************************************/
/***************************************************************************/
///feelin.library / F_LogA
/* The user can choose from which error level F_LogA() is allowed to write
in the debug console. */
enum {
FV_ERLV_USER,
/* This error level should only be used for major errors e.g.
application cannot be created, window cannot be opened... The goal
of this error level is to give information on errors that may
confuse the user (not the developper) */
FV_ERLV_DEV,
/* This error level is for people writting custom classes. It is
generaly used by external classes */
FV_ERLV_CLASS,
/* This error level is for feelin class management : class creation
and handle, dynamic system, object creation and handle... */
FV_ERLV_CORE
/* A very low-level error only used for memory troubles (e.g.
disposing a block that does not exists, or memory allocation
failure), hash link errors (e.g. removing a non linked node)... */
};
//+
/***************************************************************************/
/*** Low-level Objects *****************************************************/
/***************************************************************************/
///FC_Object 0x000000
#define FR_Object 0x000000
#define FR_Object_MTHD (MTHD_BASE | FR_Object)
#define FR_Object_ATTR (ATTR_BASE | FR_Object)
#define FC_Object "Object"
#define FM_New (FR_Object_MTHD + 0)
#define FM_Dispose (FR_Object_MTHD + 1)
#define FM_Get (FR_Object_MTHD + 2)
#define FM_Set (FR_Object_MTHD + 3)
#define FM_Notify (FR_Object_MTHD + 4)
#define FM_UnNotify (FR_Object_MTHD + 5)
#define FM_CallHook (FR_Object_MTHD + 6)
#define FM_CallHookEntry (FR_Object_MTHD + 7)
#define FM_WriteLong (FR_Object_MTHD + 8)
#define FM_WriteString (FR_Object_MTHD + 9)
#define FM_MultiSet (FR_Object_MTHD + 10)
#define FM_SetAsString (FR_Object_MTHD + 11)
#define FM_Export (FR_Object_MTHD + 12) /* The Methods bellow are general methods */
#define FM_Import (FR_Object_MTHD + 13)
#define FM_Connect (FR_Object_MTHD + 14)
#define FM_Disconnect (FR_Object_MTHD + 15)
#define FM_AddMember (FR_Object_MTHD + 16)
#define FM_RemMember (FR_Object_MTHD + 17)
typedef void FNotifyHandler;
struct FS_Notify { ULONG Attribute; ULONG Value; FObject Target; ULONG Method; ULONG Count; /*...*/ };
struct FS_UnNotify { FNotifyHandler *Handler; };
struct FS_CallHook { struct Hook *Hook; /*...*/ };
struct FS_CallHookEntry { FHookEntry Entry; /*...*/ };
struct FS_Export { FObject Dataspace; ULONG id_Add; };
struct FS_Import { FObject Dataspace; ULONG id_Find; };
struct FS_Connect { FObject Parent; };
struct FS_AddMember { FObject Object; ULONG Position; FObject Previous; };
struct FS_RemMember { FObject Member; };
#define FA_Class (FR_Object_ATTR + 0) // [..G]
#define FA_Revision (FR_Object_ATTR + 1) // [..G]
#define FA_Version (FR_Object_ATTR + 2) // [..G]
#define FA_ID (FR_Object_ATTR + 3) // [I.G] - Altought defined here, this attribute *must* be handled by sub-classes
#define FA_UserData (FR_Object_ATTR + 4)
#define FA_NoNotify (FR_Object_ATTR + 5)
#define FA_Parent (FR_Object_ATTR + 6)
#define FA_Child (FR_Object_ATTR + 7)
#define FA_ContextHelp (FR_Object_ATTR + 8)
#define FA_ContextMenu (FR_Object_ATTR + 9)
enum {
FV_Notify_None,
FV_Notify_Self,
FV_Notify_Parent,
FV_Notify_Window,
FV_Notify_Application
};
#define FV_Notify_Always 0x49893131
#define FV_Notify_Toggle 0x49893132
#define FV_Notify_Value 0x49893131
enum {
FV_AddMember_Head = -1,
FV_AddMember_Tail,
FV_AddMember_Insert
};
#define _class(o) ((struct FeelinClass *)(((ULONG *)(o))[-1]))
#define _classname(o) (_class(o) -> Name)
//+
///FC_Class 0x000040
#define FR_Class 0x000040
#define FR_Class_MTHD (MTHD_BASE | FR_Class)
#define FR_Class_ATTR (ATTR_BASE | FR_Class)
#define FC_Class "Class"
#define FA_Class_Name (FR_Class_ATTR + 0) // META
#define FA_Class_Super (FR_Class_ATTR + 1)
#define FA_Class_LODSize (FR_Class_ATTR + 2)
#define FA_Class_Dispatcher (FR_Class_ATTR + 3)
#define FA_Class_Init (FR_Class_ATTR + 4) // META
#define FA_Class_Exit (FR_Class_ATTR + 5) // META
#define FA_Class_UserData (FR_Class_ATTR + 6) // META
#define FA_Class_Pool (FR_Class_ATTR + 7) // META
#define FA_Class_Methods (FR_Class_ATTR + 8)
#define FA_Class_Attributes (FR_Class_ATTR + 9)
#define FA_Class_ResolveTable (FR_Class_ATTR + 10) // META
#define FA_Class_MethodsTable (FR_Class_ATTR + 11)
#define FA_Class_AutoResolveTable (FR_Class_ATTR + 12) // META
#define FA_Class_CatalogName (FR_Class_ATTR + 13) // META
#define FA_Class_CatalogTable (FR_Class_ATTR + 14) // META
/*
Currently, external class have only one function FCC_Query(). This function
is called to obtain information on the class e.g. tag items to build the
class, or tag items to build a PreferenceGroup to modify preferences...
F_QUERY()
{
switch (Which)
{
case FV_Query_ClassTags:
{
return ClassTags;
}
case FV_Query_PrefsTags:
{
return PrefsTags;
}
}
return NULL;
}
*/
enum {
FV_Query_ClassTags = 1,
FV_Query_PrefsTags
};
typedef struct FeelinClass FClass;
typedef struct FeelinMethodEntry FMethodEntry;
typedef struct FeelinDynamicEntry FDynamicEntry;
typedef struct FeelinCatalogEntry FCatalogEntry;
struct FeelinDynamicEntry
{
STRPTR Name;
ULONG ID;
};
struct FeelinClass
{
struct FeelinClass *Next;
struct FeelinClass *Prev;
// end of FeelinNode header -> FIXME: embended nodes will disapear in the future
STRPTR Name;
UWORD Offset;
UWORD LODSize;
APTR UserData;
ULONG UserCount;
struct FeelinClass *Super;
struct FeelinDynamicEntry *Methods; // see FA_Class_Methods
struct FeelinDynamicEntry *Attributes; // see FA_Class_Attributes
struct FeelinDynamicEntry *ResolvedIDs; // see FA_Class_ResolveTable
struct FeelinDynamicEntry *AutoResolvedIDs; // see FA_Class_AutoResolveTable
};
typedef unsigned long (ASM *FMethod)(REG_A2 struct FeelinClass *Class,REG_A0 FObject Obj,REG_D0 ULONG Method,REG_A1 APTR Msg);
typedef unsigned long (ASM *FClassInit)(REG_A2 struct FeelinClass *Class);
typedef unsigned long (ASM *FClassExit)(REG_A2 struct FeelinClass *Class);
struct FeelinMethodEntry
{
FMethod Method;
STRPTR Name;
ULONG ID;
};
struct FeelinCatalogEntry
{
ULONG ID;
STRPTR String;
STRPTR Default;
};
/*** Macros ***/
#define F_QUERY() SAVEDS ASM struct TagItem * FCC_Query(REG_D0 ULONG Which,REG_A0 struct FeelinBase *Feelin)
#define F_INIT() SAVEDS ASM BOOL FCC_Init(REG_A2 struct FeelinClass *Class)
#define F_EXIT() SAVEDS ASM void FCC_Exit(REG_A2 struct FeelinClass *Class)
#define F_METHOD(rc,name) SAVEDS ASM rc name(REG_A2 struct FeelinClass *Class,REG_A0 FObject Obj,REG_D0 ULONG Method,REG_A1 APTR Msg)
#define F_METHODM(rc,name,fs) SAVEDS ASM rc name(REG_A2 struct FeelinClass *Class,REG_A0 FObject Obj,REG_D0 ULONG Method,REG_A1 struct fs *Msg)
#define F_HOOK(rc,name) SAVEDS ASM rc name(REG_A0 struct Hook *Hook,REG_A2 FObject Obj,REG_A1 APTR Msg)
#define F_HOOKH(rc,name,hs) SAVEDS ASM rc name(REG_A0 struct hs *Hook,REG_A2 FObject Obj,REG_A1 APTR Msg)
#define F_HOOKM(rc,name,fs) SAVEDS ASM rc name(REG_A0 struct Hook *Hook,REG_A2 FObject Obj,REG_A1 struct fs *Msg)
#define F_HOOKHM(rc,name,hs,fs) SAVEDS ASM rc name(REG_A0 struct hs *Hook,REG_A2 FObject Obj,REG_A1 struct fs *Msg)
#define F_SUPERDO() F_SuperDoA(Class,Obj,Method,Msg)
#define F_OBJDO(o) F_DoA(o,Method,Msg)
#define F_STORE(val) *((ULONG *)(item.ti_Data)) = (ULONG)(val) /* Only for Classes using F_DynamicNTI() */
#define F_LOD(cl,o) ((APTR)((ULONG)(o) + cl -> Offset)) /* Used by within classes to get LocalObjectData */
#define F_ID(tab,n) (tab[n].ID)
#define F_IDM(n) F_ID(Class -> Methods,n)
#define F_IDA(n) F_ID(Class -> Attributes,n)
#define F_IDR(n) F_ID(Class -> ResolvedIDs,n)
#define F_IDO(n) F_ID(Class -> AutoResolvedIDs,n)
#define F_CAT(n) (FCC_CatalogTable[CAT_ ## n].String)
//+
///FC_Semaphore 0x000080
#define FR_Semaphore 0x000080
#define FR_Semaphore_MTHD (MTHD_BASE | FR_Semaphore)
#define FR_Semaphore_ATTR (ATTR_BASE | FR_Semaphore)
#define FC_Semaphore "Semaphore"
#define FM_Semaphore_Lock (FR_Semaphore_MTHD + 0)
#define FM_Semaphore_Unlock (FR_Semaphore_MTHD + 1)
#define FA_Semaphore_Name (FR_Semaphore_ATTR + 0)
#define FA_Semaphore_Public (FR_Semaphore_ATTR + 1)
#define FF_Semaphore_Exclusive (0)
#define FF_Semaphore_Shared (1L << 0)
#define FF_Semaphore_Attempt (1L << 1)
//+
///FC_Server 0x0000C0
#define FR_Server 0x0000C0
#define FR_Server_MTHD (MTHD_BASE | FR_Server)
#define FR_Server_ATTR (ATTR_BASE | FR_Server)
#define FC_Server "Server"
#define FM_Server_Find (FR_Server_MTHD + 0)
#define FM_Server_Open (FR_Server_MTHD + 1)
#define FM_Server_Close (FR_Server_MTHD + 2)
#define FM_Server_Create (FR_Server_MTHD + 3)
#define FM_Server_Delete (FR_Server_MTHD + 4)
#define FM_Server_Shutdown (FR_Server_MTHD + 5)
#define FA_Server_Port (FR_Server_ATTR + 0) // [..G]
#define FA_Server_Entry (FR_Server_ATTR + 1) // [I..]
#define FA_Server_StackSize (FR_Server_ATTR + 3) // [I..]
#define FA_Server_Priority (FR_Server_ATTR + 4) // [I..]
#define FA_Server_Node (FR_Server_ATTR + 5) // [..G] PRIVATE
#define FA_Server_Name FA_Semaphore_Name
struct FeelinServerMessage
{
struct Node mn_Node;
struct MsgPort *mn_ReplyPort;
UWORD mn_Length;
/* end of Message Header */
UWORD pad0;
ULONG Method;
APTR Msg;
ULONG Return;
};
//+
/***************************************************************************/
/*** Support ***************************************************************/
/***************************************************************************/
///FC_Render 0x900000
#define FR_Render 0x900000
#define FR_Render_MTHD (MTHD_BASE | FR_Render)
#define FR_Render_ATTR (ATTR_BASE | FR_Render)
#define FC_Render "Render"
#define FA_Render_Application (FR_Render_ATTR + 0) // [I..] APTR - MUST be defined on creation time
#define FA_Render_Display (FR_Render_ATTR + 1) // [I..] APTR - MUST be defined on creation time
#define FA_Render_Window (FR_Render_ATTR + 2)
#define FA_Render_RPort (FR_Render_ATTR + 3)
#define FA_Render_Palette (FR_Render_ATTR + 4)
#define FA_Render_Friend (FR_Render_ATTR + 5) // [I..]
#define FA_Render_Forbid (FR_Render_ATTR + 6)
#define FM_Render_AddClip (FR_Render_MTHD + 0)
#define FM_Render_RemClip (FR_Render_MTHD + 1)
#define FM_Render_AddClipRegion (FR_Render_MTHD + 2)
struct FS_Render_AddClip { struct FeelinRect *Rect; };
struct FS_Render_RemClip { APTR Handle; };
struct FS_Render_AddClipRegion { struct Region *Region; };
struct FeelinRender
{
FObject Application; // Valid between FM_Setup / FM_Cleanup
FObject Display;
FObject Window; // Valid between FM_Setup / FM_Cleanup
struct RastPort *RPort; // Valid between FM_Show / FM_Hide
struct FeelinPalette *Palette; // Set at will
ULONG Flags;
/* private data below */
};
typedef struct FeelinRender FRender;
#define FF_Render_Refreshing (1L << 0) // Refeshing window
#define FF_Render_Complex (1L << 1) // complex refresh requested
#define FF_Render_TrueColors (1L << 30) // Display Context is Hi-Color (>=15) or True-Color space
#define FF_Render_Forbid (1L << 31) // Forbid F_Draw()
//+
///FC_Family 0x900040
#define FR_Family 0x900040
#define FR_Family_MTHD (MTHD_BASE | FR_Family)
#define FR_Family_ATTR (ATTR_BASE | FR_Family)
#define FC_Family "Family"
#define FA_Family (FR_Family_ATTR + 0) // [..G] - General attribute
#define FA_Family_Head (FR_Family_ATTR + 1) // [..G]
#define FA_Family_Tail (FR_Family_ATTR + 2) // [..G]
#define FA_Family_Owner (FR_Family_ATTR + 3) // [I..]
struct FeelinFamilyNode
{
struct FeelinFamilyNode *Next;
struct FeelinFamilyNode *Prev;
FObject Object;
};
typedef struct FeelinFamilyNode FFamilyNode;
//+
///FC_FrameDisplay 0x900080
#define FR_FrameDisplay 0x900080
#define FR_FrameDisplay_MTHD (MTHD_BASE | FR_FrameDisplay)
#define FR_FrameDisplay_ATTR (ATTR_BASE | FR_FrameDisplay)
#define FC_FrameDisplay "FrameDisplay"
#define FM_FrameDisplay_Draw (FR_FrameDisplay_MTHD + 0)
struct FS_FrameDisplay_Draw { struct FeelinBox *Box; struct FeelinRender *Render; ULONG Flags; };
#define FA_Back (FR_FrameDisplay_ATTR + 0)
#define FA_Frame (FR_FrameDisplay_ATTR + 1)
#define FA_Frame_Font (FR_FrameDisplay_ATTR + 2)
#define FA_Frame_Title (FR_FrameDisplay_ATTR + 3)
#define FA_Frame_PreParse (FR_FrameDisplay_ATTR + 4)
#define FA_Frame_Position (FR_FrameDisplay_ATTR + 5)
#define FA_Frame_AreaObject (FR_FrameDisplay_ATTR + 6) // PRIVATE
#define FV_Frame_None 0L
#define FV_Frame_LastBuiltin 255//49
enum { FV_Frame_UpLeft, /* FA_Frame_Position */
FV_Frame_UpRight,
FV_Frame_UpCenter,
FV_Frame_DownLeft,
FV_Frame_DownRight,
FV_Frame_DownCenter };
#define FF_Frame_Fill (1L << 00) // FM_FrameDisplay_Draw
#define FF_Frame_Select (1L << 01) // FM_FrameDisplay_Draw
struct FeelinInner
{
UBYTE l;
UBYTE t;
UBYTE r;
UBYTE b;
};
typedef struct FeelinInner FInner;
struct FeelinFrameDisplay
{
FInner Border[2];
FInner Space[2];
UWORD ID[2];
// end of public datas
};
#define FrameDisplayObject F_NewObj(FC_FrameDisplay
#define NoFrame FA_Frame, FV_Frame_None
#define ButtonFrame FA_Frame,"FP_Button_Frame"
#define TextFrame FA_Frame,"FP_Text_Frame"
#define StringFrame FA_Frame,"FP_String_Frame"
#define PropFrame FA_Frame,"FP_Prop_Frame"
#define SliderFrame FA_Frame,"FP_Slider_Frame"
#define GaugeFrame FA_Frame,"FP_Gauge_Frame"
#define GroupFrame FA_Frame,"FP_Group_Frame"
//+
///FC_ImageDisplay 0x9000C0
#define FR_ImageDisplay 0x9000C0
#define FR_ImageDisplay_MTHD (MTHD_BASE | FR_ImageDisplay)
#define FR_ImageDisplay_ATTR (ATTR_BASE | FR_ImageDisplay)
#define FC_ImageDisplay "ImageDisplay"
#define FM_ImageDisplay_Setup (FR_ImageDisplay_MTHD + 0)
#define FM_ImageDisplay_Cleanup (FR_ImageDisplay_MTHD + 1)
#define FM_ImageDisplay_Draw (FR_ImageDisplay_MTHD + 2)
#define FM_ImageDisplay_Size (FR_ImageDisplay_MTHD + 3)
struct FS_ImageDisplay_Setup { struct FeelinRender *Render; };
struct FS_ImageDisplay_Cleanup { struct FeelinRender *Render; };
struct FS_ImageDisplay_Draw { struct FeelinRender *Render; struct FeelinRect *Rect; ULONG Flags; };
struct FS_ImageDisplay_Size { ULONG Width, Height; ULONG Flags; };
struct FS_ImageDisplay_HookDraw { struct FeelinRender *Render; struct FeelinRect *Rect; ULONG Flags; struct FeelinRect *Region; };
#define FA_ImageDisplay_Spec (FR_ImageDisplay_ATTR + 0)
#define FA_ImageDisplay_State (FR_ImageDisplay_ATTR + 1)
#define FA_ImageDisplay_Width (FR_ImageDisplay_ATTR + 2)
#define FA_ImageDisplay_Height (FR_ImageDisplay_ATTR + 3)
#define FF_ImageDisplay_Region (1L << 0) /* FM_ImageDisplay_Draw flags - Indicate that Msg -> Rect is in fact a pointer to a struct Region (holding one or more rectangles) */
/* Builtin patterns */
enum { FI_None,
FI_Shine, FI_HalfShine, FI_Fill, FI_HalfShadow, FI_Shadow, FI_HalfDark, FI_Dark, FI_Highlight,
FI_Shine_HalfShine, FI_HalfShine_Fill, FI_Fill_HalfShadow, FI_HalfShadow_Shadow, FI_Shadow_HalfDark, FI_HalfDark_Dark, FI_Dark_Highlight,
FI_Shine_Fill, FI_HalfShine_HalfShadow, FI_Fill_Shadow, FI_HalfShadow_HalfDark, FI_Shadow_Dark, FI_HalfDark_Highlight,
FI_Shine_HalfShadow, FI_HalfShine_Shadow, FI_Fill_HalfDark, FI_HalfShadow_Dark, FI_Shadow_Highlight,
FI_Shine_Shadow, FI_HalfShine_HalfDark, FI_Fill_Dark, FI_HalfShadow_Highlight,
FI_Shine_HalfDark, FI_HalfShine_Dark, FI_Fill_Highlight,
FI_Shine_Dark, FI_HalfShine_Highlight,
FI_Shine_Highlight };
#define ImageDisplayObject F_NewObj(FC_ImageDisplay
//+
///FC_TextDisplay 0x900100
#define FR_TextDisplay 0x900100
#define FR_TextDisplay_MTHD (MTHD_BASE | FR_TextDisplay)
#define FR_TextDisplay_ATTR (ATTR_BASE | FR_TextDisplay)
#define FC_TextDisplay "TextDisplay"
#define FM_TextDisplay_Setup (FR_TextDisplay_MTHD + 0)
#define FM_TextDisplay_Cleanup (FR_TextDisplay_MTHD + 1)
#define FM_TextDisplay_Draw (FR_TextDisplay_MTHD + 2)
struct FS_TextDisplay_Setup { FRender *Render; };
struct FS_TextDisplay_Draw { struct FeelinRect *Rect; ULONG Flags; };
#define FA_TextDisplay_Contents (FR_TextDisplay_ATTR + 0)
#define FA_TextDisplay_PreParse (FR_TextDisplay_ATTR + 1)
#define FA_TextDisplay_Font (FR_TextDisplay_ATTR + 2)
#define FA_TextDisplay_Width (FR_TextDisplay_ATTR + 3)
#define FA_TextDisplay_Height (FR_TextDisplay_ATTR + 4)
#define FA_TextDisplay_Shortcut (FR_TextDisplay_ATTR + 5)
//+
/***************************************************************************/
/*** GUI System ************************************************************/
/***************************************************************************/
///Application 0x004000
#define FR_Application 0x004000
#define FR_Application_MTHD (MTHD_BASE | FR_Application)
#define FR_Application_ATTR (ATTR_BASE | FR_Application)
#define FC_Application "Application"
#define FM_Application_Run (FR_Application_MTHD + 0)
#define FM_Application_Shutdown (FR_Application_MTHD + 1)
#define FM_Application_Sleep (FR_Application_MTHD + 2) // PRIVATE
#define FM_Application_Awake (FR_Application_MTHD + 3) // PRIVATE
#define FM_Application_PushMethod (FR_Application_MTHD + 4)
#define FM_Application_Setup (FR_Application_MTHD + 5) // PRIVATE
#define FM_Application_Cleanup (FR_Application_MTHD + 6) // PRIVATE
#define FM_Application_Load (FR_Application_MTHD + 7)
#define FM_Application_Save (FR_Application_MTHD + 8)
#define FM_Application_Resolve (FR_Application_MTHD + 9)
#define FM_Application_ResolveInt (FR_Application_MTHD + 10)
#define FM_Application_OpenFont (FR_Application_MTHD + 11)
#define FM_Application_AddSignalHandler (FR_Application_MTHD + 12)
#define FM_Application_RemSignalHandler (FR_Application_MTHD + 13)
#define FM_Application_CollectSignals (FR_Application_MTHD + 14) // STRICTLY PRIVATE
#define FM_Application_NewPrefs (FR_Application_MTHD + 15) // PRIVATE
#define FM_Application_OpenPrefs (FR_Application_MTHD + 16) // PRIVATE
#define FM_Application_ClosePrefs (FR_Application_MTHD + 17) // PRIVATE
struct FS_Application_PushMethod { FObject Target; ULONG Method ; ULONG Count; /*...*/ };
struct FS_Application_Load { STRPTR Name; };
struct FS_Application_Save { STRPTR Name; };
struct FS_Resolve { STRPTR Name; ULONG Default; };
struct FS_OpenFont { FObject Object; STRPTR Spec; };
struct FS_Application_AddSignalHandler { struct FeelinSignalHandler *Handler; };
struct FS_Application_RemSignalHandler { struct FeelinSignalHandler *Handler; };
#define FA_Application (FR_Application_ATTR + 0) // GENERAL
#define FA_Application_Title (FR_Application_ATTR + 1) // [I..]
#define FA_Application_Version (FR_Application_ATTR + 2) // [I..]
#define FA_Application_Copyright (FR_Application_ATTR + 3) // [I..]
#define FA_Application_Author (FR_Application_ATTR + 4) // [I..]
#define FA_Application_Description (FR_Application_ATTR + 5) // [I..]
#define FA_Application_Base (FR_Application_ATTR + 6) // [I..]
#define FA_Application_Unique (FR_Application_ATTR + 7) // [I..]
#define FA_Application_Signal (FR_Application_ATTR + 8)
#define FA_Application_UserSignals (FR_Application_ATTR + 9)
#define FA_Application_WindowPort (FR_Application_ATTR + 10) // [..G]
#define FA_Application_BrokerPort (FR_Application_ATTR + 11) // [..G]
#define FA_Application_BrokerHook (FR_Application_ATTR + 12) // [IS.]
#define FA_Application_BrokerPri (FR_Application_ATTR + 13) // [IS.]
#define FA_Application_Broker (FR_Application_ATTR + 14)
#define FA_Application_Display (FR_Application_ATTR + 15) // [..G]
#define FA_Application_OBJSpace (FR_Application_ATTR + 16) // [..G]
#define FA_Application_OBJPrefs (FR_Application_ATTR + 17)
#define FA_Application_Sleep (FR_Application_ATTR + 18) // [ISG]
#define FA_Application_State (FR_Application_ATTR + 19) // [..G]
enum { FV_Application_ENV,
FV_Application_ENVARC,
FV_Application_BOTH };
enum { FV_Application_Unknown,
FV_Application_Sleep, // All window closed (sleep mode)
FV_Application_Awake }; // Windows opened (awake mode)
enum { FV_KEY_NONE,
FV_KEY_PRESS,
FV_KEY_RELEASE,
FV_KEY_UP,
FV_KEY_DOWN,
FV_KEY_STEPUP,
FV_KEY_STEPDOWN,
FV_KEY_TOP,
FV_KEY_BOTTOM,
FV_KEY_LEFT,
FV_KEY_RIGHT,
FV_KEY_STEPLEFT,
FV_KEY_STEPRIGHT,
FV_KEY_FIRST,
FV_KEY_LAST,
FV_KEY_CHARBACK,
FV_KEY_CHARDEL,
FV_KEY_WORDBACK,
FV_KEY_WORDDEL,
FV_KEY_LINEBACK,
FV_KEY_LINEDEL,
FV_KEY_NEXTOBJ,
FV_KEY_PREVOBJ,
FV_KEY_NOOBJ,
FV_KEY_CLOSEWINDOW,
FV_KEY_COUNT };
#define ApplicationObject F_NewObj(FC_Application
#define AppObject F_NewObj(FC_Application
/*** FeelinSignalHandler ***************************************************/
typedef struct FeelinSignalHandler FSignalHandler;
struct FeelinSignalHandler
{
struct FeelinSignalHandler *Next;
struct FeelinSignalHandler *Prev;
/* end of FeelinNode header */
ULONG Flags;
struct FeelinObject *Object;
ULONG Method;
union
{
struct
{
ULONG Signals;
ULONG Reserved;
} fsh_sig;
struct
{
ULONG Secs;
ULONG Micros;
} fsh_timer;
} fsh_union;
};
#define fsh_Signals fsh_union.fsh_sig.Signals
#define fsh_Secs fsh_union.fsh_timer.Secs
#define fsh_Micros fsh_union.fsh_timer.Micros
#define FF_SignalHandler_Timer (1L << 0)
/*** FeelinEvent ***********************************************************/
struct FeelinEvent
{
struct IntuiMessage *IMsg; // Original IntuiMessage
ULONG Flags; // FF_Event_Xxx
ULONG Class;
UWORD Code;
UWORD Qualifier;
UBYTE Key; // depeding on user configurable short cuts.
UBYTE DecodedChar; // If event is IDCMP_RAWKEY FC_Application will try to decode the event as a char.
UWORD reserved;
WORD MouseX;
WORD MouseY;
ULONG Seconds;
ULONG Micros;
APTR Window; // WindowObject of the Event
};
#define FF_Event_KeyUp (1L << 0) // IDCMP_RAWKEY - Key is up (released)
#define FF_Event_Repeat (1L << 1) // IDCMP_RAWKEY - Key is held down
#define FF_Event_DoubleClick (1L << 0) // IDCMP_MOUSEBUTTONS - Mouse double click - Although defined here, this flag is set by FC_Window
//+
///Window 0x004040
#define FR_Window 0x004040
#define FR_Window_MTHD (MTHD_BASE | FR_Window)
#define FR_Window_ATTR (ATTR_BASE | FR_Window)
#define FC_Window "Window"
#define FM_Window_Setup (FR_Window_MTHD + 0)
#define FM_Window_Cleanup (FR_Window_MTHD + 1)
#define FM_Window_Open (FR_Window_MTHD + 2)
#define FM_Window_Close (FR_Window_MTHD + 3)
#define FM_Window_ChainAdd (FR_Window_MTHD + 4)
#define FM_Window_ChainRem (FR_Window_MTHD + 5)
#define FM_Window_AddEventHandler (FR_Window_MTHD + 6)
#define FM_Window_RemEventHandler (FR_Window_MTHD + 7)
#define FM_Window_HandleEvent (FR_Window_MTHD + 8)
#define FM_Window_Layout (FR_Window_MTHD + 9)
#define FM_Window_Draw (FR_Window_MTHD + 10)
#define FM_Window_Zoom (FR_Window_MTHD + 11)
#define FM_Window_Depth (FR_Window_MTHD + 12)
#define FM_Window_ForEach (FR_Window_MTHD + 13)
struct FS_Window_ChainAdd { FObject Object; };
struct FS_Window_ChainRem { FObject Object; };
struct FS_Window_AddEventHandler { struct FeelinEventHandler *Handler; };
struct FS_Window_RemEventHandler { struct FeelinEventHandler *Handler; };
struct FS_Window_Zoom { ULONG Zoom; };
struct FS_Window_Depth { ULONG Depth; };
//struct FS_Window_ForEach { FWindow_EachFunc Func; APTR UserData; };
#define FA_Window (FR_Window_ATTR + 0)
#define FA_Window_Title (FR_Window_ATTR + 1)
#define FA_Window_ScreenTitle (FR_Window_ATTR + 2)
#define FA_Window_Open (FR_Window_ATTR + 3)
#define FA_Window_CloseRequest (FR_Window_ATTR + 4)
#define FA_Window_Active (FR_Window_ATTR + 5)
#define FA_Window_ActiveObject (FR_Window_ATTR + 6)
#define FA_Window_Backdrop (FR_Window_ATTR + 7)
#define FA_Window_Borderless (FR_Window_ATTR + 8)
#define FA_Window_Resizable (FR_Window_ATTR + 9)
#define FA_Window_GadNone (FR_Window_ATTR + 10)
#define FA_Window_GadDragbar (FR_Window_ATTR + 11)
#define FA_Window_GadClose (FR_Window_ATTR + 12)
#define FA_Window_GadDepth (FR_Window_ATTR + 13)
#define FA_Window_GadIconify (FR_Window_ATTR + 14)
#define FA_Window_Decorator (FR_Window_ATTR + 15)
#define FA_Window_HandlePopHelp (FR_Window_ATTR + 16)
//#define FA_Window_MouseObject (FR_Window_ATTR + 13)
enum {
FV_Window_ActiveObject_Prev = -2,
FV_Window_ActiveObject_Next,
FV_Window_ActiveObject_None
};
enum {
FV_Window_Zoom_Full = - 3,
FV_Window_Zoom_Max,
FV_Window_Zoom_Toggle
};
enum {
FV_Window_Depth_Back = -3,
FV_Window_Depth_Front,
FV_Window_Depth_Toggle
};
#define WindowObject F_NewObj(FC_Window
/***************************************************************************/
/*** FeelinEventHandler ****************************************************/
/***************************************************************************/
struct FeelinEventHandler
{
struct FeelinEventHandler *Next;
struct FeelinEventHandler *Prev;
/* end of FeelinNode header */
UWORD Flags;
BYTE Priority; // Linked by priority
UBYTE reserved;
ULONG Events; // One or more IDCMP flags this handler should react on
FObject Object; // Object which should receive FM_HandleEvent
struct FeelinClass *Class; // If class <> NIL then class will be called instead of object.class
};
#define FF_HandleEvent_Eat (1L << 00)
//+
///Display 0x004080
#define FR_Display 0x004080
#define FR_Display_MTHD (MTHD_BASE | FR_Display)
#define FR_Display_ATTR (ATTR_BASE | FR_Display)
#define FC_Display "Display"
#define FM_AddColor (FR_Display_MTHD + 0)
#define FM_RemColor (FR_Display_MTHD + 1)
#define FM_AddPalette (FR_Display_MTHD + 2)
#define FM_RemPalette (FR_Display_MTHD + 3)
#define FM_CreateColor (FR_Display_MTHD + 4)
#define FM_DeleteColor (FM_RemColor)
#define FM_CreateColorScheme (FR_Display_MTHD + 5)
#define FM_DeleteColorScheme (FM_RemPalette)
#define FA_ColorScheme (FR_Display_ATTR + 0)
enum {
FV_Pen_Text, // 0
FV_Pen_Shine, // 1
FV_Pen_HalfShine, // 2
FV_Pen_Fill, // 3
FV_Pen_HalfShadow, // 4
FV_Pen_Shadow, // 5
FV_Pen_HalfDark, // 6
FV_Pen_Dark, // 7
FV_Pen_Highlight, // 8
FV_PEN_COUNT
};
#define FV_COLOR_SPACE 12
enum {
FV_Display_Frontmost = -2,
FV_Display_Workbench,
FV_Display_Public
}; // FA_Display_Name
/*** TYPES *****************************************************************/
struct FeelinColor
{
ULONG _priv0;
ULONG _priv1;
ULONG Pen;
ULONG ARGB;
};
typedef struct FeelinColor FColor;
struct FeelinPalette
{
ULONG _priv0;
ULONG _priv1;
ULONG _priv2;
ULONG Count;
ULONG *Pens;
ULONG *ARGB;
FColor **Colors;
};
typedef struct FeelinPalette FPalette;
/*** Method's structures ***/
struct FS_AddColor { ULONG ARGB; };
struct FS_RemColor { FColor *Color; };
struct FS_AddPalette { ULONG Count; ULONG *ARGBs; };
struct FS_RemPalette { FPalette *Palette; };
struct FS_CreateColor { STRPTR Spec; FPalette *Reference; };
struct FS_DeleteColor { FColor *Color; };
struct FS_CreateColorScheme { STRPTR Spec; FPalette *Reference; };
struct FS_DeleteColorScheme { FPalette *Palette; };
//+
/*** GUI Classes ***********************************************************/
///Area 0x001000
#define FR_Area 0x001000
#define FC_Area "Area"
#define FR_Area_MTHD (MTHD_BASE | FR_Area)
#define FR_Area_ATTR (ATTR_BASE | FR_Area)
/*** methods ***************************************************************/
#define FM_Setup (FR_Area_MTHD + 0)
#define FM_Cleanup (FR_Area_MTHD + 1)
#define FM_Show (FR_Area_MTHD + 2)
#define FM_Hide (FR_Area_MTHD + 3)
#define FM_AskMinMax (FR_Area_MTHD + 4)
#define FM_Layout (FR_Area_MTHD + 5)
#define FM_Draw (FR_Area_MTHD + 6)
#define FM_Erase (FR_Area_MTHD + 7)
#define FM_HandleEvent (FR_Area_MTHD + 8)
#define FM_ModifyHandler (FR_Area_MTHD + 9)
#define FM_GoActive (FR_Area_MTHD + 10)
#define FM_GoInactive (FR_Area_MTHD + 11)
#define FM_GoEnabled (FR_Area_MTHD + 12)
#define FM_GoDisabled (FR_Area_MTHD + 13)
#define FM_DnDDo (FR_Area_MTHD + 14)
#define FM_DnDQuery (FR_Area_MTHD + 15)
#define FM_DnDBegin (FR_Area_MTHD + 16)
#define FM_DnDFinish (FR_Area_MTHD + 17)
#define FM_DnDReport (FR_Area_MTHD + 18)
#define FM_DnDDrop (FR_Area_MTHD + 19)
#define FM_RethinkLayout (FR_Area_MTHD + 20)
#define FM_BuildContextMenu (FR_Area_MTHD + 21)
#define FM_BuildContextHelp (FR_Area_MTHD + 22)
struct FS_Setup { struct FeelinRender *Render; };
struct FS_Draw { ULONG Flags; };
struct FS_Erase { struct FeelinRect *Rect; ULONG Flags; };
struct FS_HandleEvent { struct FeelinEvent *FEv; };
struct FS_ModifyHandler { ULONG Add; ULONG Sub; };
struct FS_DnDDo { LONG MouseX, MouseY; };
struct FS_DnDQuery { LONG MouseX, MouseY; FObject *Source; struct FeelinBox *Box; };
struct FS_DnDBegin { FObject *Source; };
struct FS_DnDFinish { FObject *Source; };
struct FS_DnDReport { LONG MouseX, MouseY; FObject *Source; ULONG Update; struct FeelinBox *DragBox; };
struct FS_DnDDrop { LONG MouseX, MouseY; FObject *Source; };
struct FS_RethinkLayout { FObject Object; };
struct FS_BuildContextHelp { LONG MouseX, MouseY; STRPTR Help; };
struct FS_BuildContextMenu { LONG MouseX, MouseY; FObject Menu, ContextOwner; struct FeelinRender *Render; };
/*** attributes ************************************************************/
#define FA_AreaData (FR_Area_ATTR + 0)
#define FA_Left (FR_Area_ATTR + 1)
#define FA_Top (FR_Area_ATTR + 2)
#define FA_Width (FR_Area_ATTR + 3)
#define FA_Height (FR_Area_ATTR + 4)
#define FA_Right (FR_Area_ATTR + 5)
#define FA_Bottom (FR_Area_ATTR + 6)
#define FA_Inner_Left (FR_Area_ATTR + 7)
#define FA_Inner_Top (FR_Area_ATTR + 8)
#define FA_Inner_Right (FR_Area_ATTR + 9)
#define FA_Inner_Bottom (FR_Area_ATTR + 10)
#define FA_Inner_Width (FR_Area_ATTR + 11)
#define FA_Inner_Height (FR_Area_ATTR + 12)
#define FA_MinWidth (FR_Area_ATTR + 13)
#define FA_MinHeight (FR_Area_ATTR + 14)
#define FA_MaxWidth (FR_Area_ATTR + 15)
#define FA_MaxHeight (FR_Area_ATTR + 16)
#define FA_FixWidth (FR_Area_ATTR + 17)
#define FA_FixHeight (FR_Area_ATTR + 18)
#define OBS_FA_FixWidthTxt (FR_Area_ATTR + 19) // deprecated
#define OBS_FA_FixHeightTxt (FR_Area_ATTR + 20) // deprecated
#define OBS_FA_Fixed (FR_Area_ATTR + 21) // deprecated , use FA_SetMin,TRUE, FA_SetMax,TRUE
#define OBS_FA_FixedWidth (FR_Area_ATTR + 22) // deprecated , use FA_SetMin,FV_SetMinW, FA_SetMax,FV_SetMaxW
#define OBS_FA_FixedHeight (FR_Area_ATTR + 23) // deprecated , use FA_SetMin,FV_SetMinH, FA_SetMax,FV_SetMaxH
#define FA_SetMin (FR_Area_ATTR + 24)
#define FA_SetMax (FR_Area_ATTR + 25)
#define FA_Active (FR_Area_ATTR + 26)
#define FA_Selected (FR_Area_ATTR + 27)
#define FA_Pressed (FR_Area_ATTR + 28)
#define FA_Hidden (FR_Area_ATTR + 29)
#define FA_Disabled (FR_Area_ATTR + 30)
#define FA_Draggable (FR_Area_ATTR + 31)
#define FA_Dropable (FR_Area_ATTR + 32)
#define FA_Horizontal (FR_Area_ATTR + 33)
#define FA_Timer (FR_Area_ATTR + 34)
#define FA_Font (FR_Area_ATTR + 35)
#define FA_Weight (FR_Area_ATTR + 36)
#define FA_NoFill (FR_Area_ATTR + 37)
#define FA_InputMode (FR_Area_ATTR + 38)
#define FA_ControlChar (FR_Area_ATTR + 39)
#define FA_ChainToCycle (FR_Area_ATTR + 40)
#define FA_WindowObject (FR_Area_ATTR + 41)
/*** values ****************************************************************/
enum { /* FM_DnDReport */
FV_DnDReport_Timer,
FV_DnDReport_Move
};
enum { /* FA_InputMode */
FV_InputMode_None,
FV_InputMode_Immediate,
FV_InputMode_Release,
FV_InputMode_Toggle
};
enum { /* FA_SetMin */
FV_SetMin = TRUE,
FV_NoSetMin,
FV_SetMinW,
FV_SetMinH
};
enum { /* FA_SetMax */
FV_SetMax = TRUE,
FV_NoSetMax,
FV_SetMaxW,
FV_SetMaxH
};
#define FV_Font_Inherit -1
#define FV_MAXMAX 10000
/*** flags *****************************************************************/
#define FF_Horizontal (1L << 0)
#define FF_Area_SetMinW (1L << 1)
#define FF_Area_SetMaxW (1L << 2)
#define FF_Area_SetMinH (1L << 3)
#define FF_Area_SetMaxH (1L << 4)
#define FF_Area_Selected (1L << 5) // PRIVATE ??
#define FF_Area_Pressed (1L << 6) // PRIVATE ??
#define FF_Area_Active (1L << 7) // PRIVATE ??
#define FF_Area_Disabled (1L << 8)
#define FF_Area_Group (1L << 12) // PRIVATE ?? This flag is set by FC_Group to recognize object as a group (only used by FM_Group_Forward)
#define FF_Area_CanDraw (1L << 13) // This object may be drawn
#define FF_Area_CanShow (1L << 14) // This object may be shown
#define FF_Area_Setup (1L << 15) // ?? USEFULL FM_Setup successful
/* FIXME: is FF_AREA_SETUP useful ??? To know if setup succeed check
_render. Only used by F_Draw(). */
/* FM_Draw flags */
#define FF_Draw_Object (1L << 0)
#define FF_Draw_Update (1L << 1)
#define FF_Draw_Custom_1 (1L << 24)
#define FF_Draw_Custom_2 (1L << 25)
#define FF_Draw_Custom_3 (1L << 26)
#define FF_Draw_Custom_4 (1L << 27)
#define FF_Draw_Custom_5 (1L << 28)
#define FF_Draw_Custom_6 (1L << 29)
#define FF_Draw_Custom_7 (1L << 30)
#define FF_Draw_Custom_8 (1L << 31)
/*** FM_Erase ***/
#define FF_Erase_Fill (1L << 0) // Force area to be filled even in refresh mode
#define FF_Erase_Region (1L << 1) //
typedef struct FeelinBox FBox;
typedef struct FeelinRect FRect;
typedef struct FeelinMinMax FMinMax;
struct FeelinBox { WORD x,y; UWORD w,h; };
struct FeelinRect { WORD x1,y1,x2,y2; };
struct FeelinMinMax { UWORD MinW,MinH,MaxW,MaxH; };
/*** FeelinAreaData ********************************************************/
typedef struct FeelinAreaData FAreaData;
struct FeelinAreaData
{
FObject Parent; // FA_Parent
FObject Next;
FObject Prev;
FRender *Render; // FC_Render object
ULONG Flags;
FBox Box;
FInner Inner;
FMinMax MinMax;
ULONG *Pens;
struct TextFont *Font;
UWORD Weight;
};
/* the following macros assume the variable 'LOD' to be declared and
holding a field 'AreaData' of type (FAreaData *). If it is not the case
undef '_areadata' and redefine it to your convenience */
#define _init_areadata LOD -> AreaData = (FAreaData *) F_Get(Obj,FA_AreaData)
#define _areadata ((FAreaData *)(LOD -> AreaData))
#define _parent (_areadata -> Parent)
#define _next (_areadata -> Next)
#define _prev (_areadata -> Prev)
#define _render (_areadata -> Render)
#define _flags (_areadata -> Flags)
#define _box (_areadata -> Box)
#define _x (_box.x)
#define _y (_box.y)
#define _w (_box.w)
#define _h (_box.h)
#define _inner (_areadata -> Inner)
#define _bl (_inner.l)
#define _bt (_inner.t)
#define _br (_inner.r)
#define _bb (_inner.b)
#define _minmax (_areadata -> MinMax)
#define _minw (_minmax.MinW)
#define _minh (_minmax.MinH)
#define _maxw (_minmax.MaxW)
#define _maxh (_minmax.MaxH)
#define _pens (_areadata -> Pens)
#define _font (_areadata -> Font)
#define _weight (_areadata -> Weight)
/* extanded coordinates macros */
#define _x2 (_x + _w - 1)
#define _y2 (_y + _h - 1)
#define _mx (_x + _bl)
#define _my (_y + _bt)
#define _mw (_w - _bl - _br)
#define _mh (_h - _bt - _bb)
#define _mx2 (_x2 - _br)
#define _my2 (_y2 - _bb)
/* macros to access "_areadata.render". !!WARNING!! "_render" *MUST* be
checked before accessing flieds */
#define _display (_render -> Display)
#define _app (_render -> Application)
#define _win (_render -> Window)
#define _rp (_render -> RPort)
/* macros that can be used while creating objects */
#define AreaObject F_NewObj(FC_Area
#define InputImmediate FA_InputMode,FV_InputMode_Immediate
#define InputRelease FA_InputMode,FV_InputMode_Release
#define InputToggle FA_InputMode,FV_InputMode_Toggle
#define DontChain FA_ChainToCycle,FALSE
#define HorizLayout FA_Horizontal,TRUE
//+
/// Group 0x001040
#define FR_Group 0x001040
#define FR_Group_MTHD (MTHD_BASE | FR_Group)
#define FR_Group_ATTR (ATTR_BASE | FR_Group)
#define FC_Group "Group"
#define FM_Group_Forward (FR_Group_MTHD + 0)
#define FM_Group_InitChange (FR_Group_MTHD + 1)
#define FM_Group_ExitChange (FR_Group_MTHD + 2)
#define FA_Group_HSpacing (FR_Group_ATTR + 0)
#define FA_Group_VSpacing (FR_Group_ATTR + 1)
#define FA_Group_SameWidth (FR_Group_ATTR + 2)
#define FA_Group_SameHeight (FR_Group_ATTR + 3)
#define FA_Group_SameSize (FR_Group_ATTR + 4)
#define FA_Group_RelSizing (FR_Group_ATTR + 5)
#define FA_Group_Title (FR_Group_ATTR + 6)
#define FA_Group_Forward (FR_Group_ATTR + 7)
#define FA_Group_PageMode (FR_Group_ATTR + 8)
#define FA_Group_PageFont (FR_Group_ATTR + 9)
#define FA_Group_PageStyle (FR_Group_ATTR + 10)
#define FA_Group_ActivePage (FR_Group_ATTR + 11)
#define FA_Group_Rows (FR_Group_ATTR + 12)
#define FA_Group_Columns (FR_Group_ATTR + 13)
#define FA_Group_LayoutHook (FR_Group_ATTR + 14)
#define FA_Group_MinMaxHook (FR_Group_ATTR + 15)
#define FA_Group_Head (FR_Group_ATTR + 16)
#define FA_Group_Tail (FR_Group_ATTR + 17)
#define FA_Group_BufferRegion (FR_Group_ATTR + 20) // PRIVATE
enum {
FV_Group_ActivePage_Prev = -3,
FV_Group_ActivePage_Next,
FV_Group_ActivePage_Last,
FV_Group_ActivePage_First
};
#define GroupObject F_NewObj(FC_Group
#define VGroup F_NewObj(FC_Group,FA_ChainToCycle,FALSE
#define HGroup F_NewObj(FC_Group,FA_ChainToCycle,FALSE,FA_Horizontal,TRUE
#define RowGroup(x) F_NewObj(FC_Group,FA_ChainToCycle,FALSE,FA_Group_Rows,x
#define ColGroup(x) F_NewObj(FC_Group,FA_ChainToCycle,FALSE,FA_Group_Columns,x
#define Page F_NewObj(FC_Group,FA_Group_PageMode,TRUE
//+
///Text 0x001080
#define FR_Text 0x001080
#define FR_Text_MTHD (MTHD_BASE | FR_Text)
#define FR_Text_ATTR (ATTR_BASE | FR_Text)
#define FC_Text "Text"
#define FA_Text (FR_Text_ATTR + 0)
#define FA_Text_PreParse (FR_Text_ATTR + 1)
#define FA_Text_AltPreParse (FR_Text_ATTR + 2)
#define FA_Text_Shortcut (FR_Text_ATTR + 3)
#define FA_Text_HCenter (FR_Text_ATTR + 4)
#define FA_Text_VCenter (FR_Text_ATTR + 5)
#define FA_Text_Static (FR_Text_ATTR + 6)
#define TextObject F_NewObj(FC_Text
#define TextBack FA_Back, "FP_Text_Back"
//+
/***************************************************************************/
/*** Dynamic Classes *******************************************************/
/***************************************************************************/
#define FC_AdjustColor "AdjustColor"
#define FC_AdjustFrame "AdjustFrame"
#define FC_AdjustImage "AdjustImage"
#define FC_AdjustScheme "AdjustScheme"
#define FC_Balance "Balance" // SUPER: FC_Area
#define FC_Bar "Bar" // SUPER: FC_Area
#define FC_Cycle "Cycle" // SUPER: FC_Group
#define FC_Dataspace "Dataspace"
#define FC_Decorator "Decorator"
#define FC_Display "Display"
#define FC_DOSNotify "DOSNotify"
#define FC_Gauge "Gauge" // SUPER: FC_Numeric
#define FC_Image "Image" // SUPER: FC_Area
#define FC_List "List"
#define FC_Numeric "Numeric" // SUPER: FC_Area
#define FC_Picture "Picture"
#define FC_PopColor "PopColor"
#define FC_PopFrame "PopFrame"
#define FC_PopHelp "PopHelp"
#define FC_PopImage "PopImage"
#define FC_PopScheme "PopScheme"
#define FC_Preference "Preference"
#define FC_PreferenceEditor "PreferenceEditor"
#define FC_PreferenceGroup "PreferenceGroup"
#define FC_PreviewColor "PreviewColor"
#define FC_PreviewFrame "PreviewFrame"
#define FC_PreviewScheme "PreviewScheme"
#define FC_Prop "Prop" // SUPER: FC_Area
#define FC_Radio "Radio"
#define FC_Slider "Slider" // SUPER: FC_Numeric
#define FC_String "String" // SUPER: FC_Area
#define AdjustColorObject F_NewObj(FC_AdjustColor
#define AdjustFrameObject F_NewObj(FC_AdjustFrame
#define AdjustImageObject F_NewObj(FC_AdjustImage
#define AdjustSchemeObject F_NewObj(FC_AdjustScheme
#define BalanceObject F_NewObj(FC_Balance
#define BalanceID(id) F_NewObj(FC_Balance,FA_ID,id,TAG_DONE)
#define BarObject F_NewObj(FC_Bar
#define CycleObject F_NewObj(FC_Cycle
#define DataspaceObject F_NewObj(FC_Dataspace
#define DecoratorObject F_NewObj(FC_Decorator
#define DOSNotifyObject F_NewObj(FC_DOSNotify
#define GaugeObject F_NewObj(FC_Gauge
#define ImageObject F_NewObj(FC_Image
#define NumericObject F_NewObj(FC_Numeric
#define PictureObject F_NewObj(FC_Picture
#define PopColorObject F_NewObj(FC_PopColor
#define PopFrameObject F_NewObj(FC_PopFrame
#define PopHelpObject F_NewObj(FC_PopHelp
#define PopImageObject F_NewObj(FC_PopImage
#define PopSchemeObject F_NewObj(FC_PopScheme
#define PreviewColorObject F_NewObj(FC_PreviewColor
#define PreviewFrameObject F_NewObj(FC_PreviewFrame
#define PreviewSchemeObject F_NewObj(FC_PreviewScheme
#define PropObject F_NewObj(FC_Prop
#define RadioObject F_NewObj(FC_Radio
#define SliderObject F_NewObj(FC_Slider
#define StringObject F_NewObj(FC_String
/***************************************************************************/
/*** Method Messages *******************************************************/
/***************************************************************************/
struct FS_Dataspace_Add { APTR Data; ULONG Size; ULONG ID; };
struct FS_Dataspace_Remove { ULONG ID; };
struct FS_Dataspace_Find { ULONG ID; };
struct FS_Dataspace_Resolve { ULONG ID; ULONG *Save; };
struct FS_Dataspace_WriteIFF { struct IFFHandle *IFF; ULONG Type; ULONG ID; };
struct FS_Dataspace_ReadIFF { struct IFFHandle *IFF; };
struct FS_DOSNotify_Notify { FObject DNObject; STRPTR FileName; };
struct FS_Picture_Draw { struct FeelinRender *Render; struct FeelinRect *Rect; ULONG Flags; };
struct FS_Prop_Decrease { LONG Value; };
struct FS_Prop_Increase { LONG Value; };
struct FS_Preference_Find { STRPTR Name; };
struct FS_Preference_Add { STRPTR Name; APTR Data; ULONG Size; };
struct FS_Preference_AddLong { STRPTR Name; ULONG Data; };
struct FS_Preference_AddString { STRPTR Name; STRPTR Data; };
struct FS_Preference_Remove { STRPTR Name; };
struct FS_Preference_Read { STRPTR Name; };
struct FS_Preference_Write { STRPTR Name; };
struct FS_Preference_Resolve { STRPTR Name; APTR Default; };
struct FS_Preference_ResolveInt { STRPTR Name; ULONG Default; };
struct FS_PreferenceGroup_Load { FObject Prefs; ULONG id_Resolve; ULONG id_ResolveInt; };
struct FS_PreferenceGroup_Save { FObject Prefs; ULONG id_Add; ULONG id_AddLong; ULONG id_AddString; };
struct FS_Numeric_Increase { LONG Value; };
struct FS_Numeric_Decrease { LONG Value; };
struct FS_Numeric_Stringify { LONG Value; };
/***************************************************************************/
/*** Values ****************************************************************/
/***************************************************************************/
enum {
FV_Image_Normal,
FV_Image_Selected,
FV_Image_Enabled,
FV_Image_Disabled
};
enum {
FV_Cycle_Prev = -3,
FV_Cycle_Next,
FV_Cycle_Last,
FV_Cycle_First
};
enum {
FV_Preference_ENV = -3,
FV_Preference_ENVARC,
FV_Preference_BOTH
};
enum {
FV_String_Left,
FV_String_Center,
FV_String_Right
};
#endif